;(function(win) {
	var MediaEngine = function() {
		return new MediaEngine.init();
	}
	
	var mediaEngineProps = MediaEngine.prototype;
	MediaEngine.init = function() {};
	MediaEngine.init.prototype = mediaEngineProps;
	MediaEngine.version ={};
	MediaEngine.version.number = "1.0.0.RELEASE";
	MediaEngine.version.author = "yumi@omuao.com";
	mediaEngineProps.setWorldOptions = function(options) {
		this.worldOptions = options;
	}
	
	win.MediaEngine = MediaEngine;
	
	//初始化媒体引擎
	if(win.JadeEngine != null && typeof win.JadeEngine !== "undefined" ){
		JadeEngine.World.prototype.setMediaEngine = function(mediaEngine){
			if(!mediaEngine instanceof MediaEngine){
				throw "MediaEngine is not set";
			}
			mediaEngine.setWordOptions(this);
			this.mediaEngine = mediaEngine;
			return this.mediaEngine;
		}
		JadeEngine.World.prototype.getMediaEngine = function(){
			if(this.mediaEngine == null || typeof this.mediaEngine === "undefined") {
				this.mediaEngine = new MediaEngine();
				this.mediaEngine.setWorldOptions(this);
			}
			return this.mediaEngine;
		}
		JadeEngine.World.prototype.getMediaEngineVersionInfo = function(){
			return MediaEngine.version;
		}
	}
}(window));